let CryptoJS = require("crypto-js");
let key= CryptoJS.enc.Utf8.parse("zjsfkt2001-09-03"),
iv = CryptoJS.enc.Utf8.parse("0123456789ABCDEF");

function encryptedFn(text) {
    let a = CryptoJS.AES.encrypt(text, key, {iv: iv,mode: CryptoJS.mode.CBC,padding: CryptoJS.pad.Pkcs7})
    let r = a.toString();
    return r
}

function decryptedFn(text) {
    let a = CryptoJS.AES.decrypt(text, key, {iv: iv,mode: CryptoJS.mode.CBC,padding: CryptoJS.pad.Pkcs7})
    let r = a.toString(CryptoJS.enc.Utf8);
    return r.toString()
}

module.exports = {
    encryptedFn,
    decryptedFn
}